﻿//-----------------------------------------------------------------------
// <copyright file="EnumHelperTests.cs" company="OverrideThis">
//     Copyright (c) 2010 OverrideThis.com
// </copyright>
//-----------------------------------------------------------------------
namespace OverrideThis.Core.Tests.Utilities
{
    using NUnit.Framework;
    using OverrideThis.Core.Utilities;

    [TestFixture]
    public class EnumHelperTests
    {
        [Test]
        public void Should_EnumerateValuesDescriptionInEnums_Correctly()
        {
            // Arrange, Act.
            var values = EnumHelper.ToKeyValuePair(typeof (TestEnum));

            // Assert.
            Assert.AreEqual(values[0].Key, "A");
            Assert.AreEqual(values[0].Key, "B");
            Assert.AreEqual(values[0].Key, "C");
            Assert.AreEqual(values[0].Value, "Alpha");
            Assert.AreEqual(values[0].Value, "Beta");
            Assert.AreEqual(values[0].Value, "Charlie");
        }

        public enum TestEnum
        {
            [System.ComponentModel.Description("Alpha")]
            A,

            [System.ComponentModel.Description("Beta")]
            B,

            [System.ComponentModel.Description("Charlie")]
            C

        }
    }
}
